package com.ccx.coachsite.task;

import android.content.Context;
import com.ccx.coachsite.http.HttpCallBack;
import com.ccx.coachsite.http.HttpRequest;
import com.ccx.coachsite.util.SharedPreferencesUtil;
import com.ccx.coachsite.util.StringUtil;

public class ShareDataTask extends TaskBase{

	private String mUrl;
	private String mShareKey;
	public ShareDataTask(HttpCallBack<?> iCall, Context context, String url, String shareKey) {
		super(iCall, context);
		mShareKey = shareKey;
		mUrl = url;
	}

	@Override
	protected String genUrl(HttpRequest request)
	{
		return mUrl;
	}
	
	@Override
	protected void onDataParse(String responseString) 
	{
		if(!StringUtil.isEmpty(responseString))
		{
			SharedPreferencesUtil.setValue(mContext, mShareKey, responseString);
		}
	}
}
